export interface LoginRes {
  token: string
  currentUser: User
}

export interface UserInfoRes {
  permissions: string[]
  roles: string[]
  user: User
}

export interface User {
  admin: boolean
  avatar: string
  bus: string[]
  createBy: string
  createName: null
  createTime: string
  currentorguuid: null
  delFlag: string
  dept: Dept
  deptCode: string
  deptId: string
  email: string
  flag: null
  isAllowedAuth: null
  isSmsAuth: null
  keyWord: null
  latnId: string
  latnName: null
  loginDate: string
  loginIp: string
  loginUserId: null
  mktDataScope: MktDataScope[]
  mktOrg: string[]
  nickName: string
  params: { [key: string]: any }
  phonenumber: string
  postIds: null
  products: string[]
  province: boolean
  pwdCreateTime: string
  pwdRule: number
  remark: string
  roleId: null
  roleIds: null
  roles: Role[]
  salt: null
  searchValue: null
  sex: string
  smsErrorNum: null
  smsErrorTime: null
  status: string
  sysCode: null
  updateBy: null
  updateTime: null
  userId: number
  userlatnId: null
  userName: string
  userNameList: null
}

export interface Dept {
  ancestors: string
  children: string[]
  createBy: null
  createTime: null
  delFlag: null
  deptFullName: string
  deptId: string
  deptName: string
  email: null
  fullName: null
  hasChildren: boolean
  isLeaf: boolean
  latnId: string
  leader: null
  numChildren: null
  orderNum: number
  params: { [key: string]: any }
  parentId: string
  parentName: null
  phone: null
  remark: null
  searchValue: null
  status: string
  updateBy: null
  updateTime: null
}

export interface MktDataScope {
  level?: string
  orgCode?: string
  orgId?: number
  orgName?: string
  userName?: string
}

export interface Role {
  admin?: boolean
  checkedKeys?: null
  createBy?: null
  createTime?: null
  dataScope?: null
  delFlag?: null
  deptCheckStrictly?: boolean
  deptIds?: null
  expandedKeys?: null
  flag?: boolean
  isAdminRole?: number
  isAdminUser?: null
  isIssued?: number
  isRoleAdmin?: number
  isSysAdminRole?: number
  keyWord?: null
  loginUserId?: null
  menuCheckStrictly?: boolean
  menuIds?: null
  menuList?: null
  params?: { [key: string]: any }
  remark?: null
  roleId?: number
  roleIdList?: null
  roleKey?: string
  roleMenuList?: null
  roleName?: string
  roleSort?: number
  searchValue?: null
  status?: string
  sysCode?: string
  sysCodeList?: null
  sysName?: null
  updateBy?: null
  updateTime?: null
  userRoleIds?: null
}

export interface UserForm {
  /**
   * 图片验证码
   */
  captcha: string
  /**
   * 短信验证码
   */
  code: string
  /**
   * 密码 加密传输
   */
  password: string
  /**
   * 用户姓名
   */
  username: string
  /**
   * 图片验证码uuid
   */
  uuid: string
}

export interface LoginUser {
  accountNonExpired: boolean
  accountNonLocked: boolean
  acetoken: null
  authorities: null
  browser: string
  credentialsNonExpired: boolean
  dataScopes: string
  deptId: string
  enabled: boolean
  expireTime: number
  ipaddr: string
  loginLocation: string
  loginTime: number
  orgId: null
  orgLevel: null
  os: string
  password: string
  permissions: string[]
  sysCode: string
  sysId: null
  token: string
  user: User
  userId: number
  username: string
}

export interface AuthLoginRes {
  loginUser: LoginUser
  token: string
}

export type RouteRes = Datum[]

export interface Datum {
  alwaysShow: boolean
  children: DatumChild[]
  component: string
  hidden: boolean
  menuId: number
  meta: DatumMeta
  name: string
  path: string
  redirect: string
  remark?: string
  targetId: number
}

export interface DatumChild {
  alwaysShow: boolean
  children: ChildChild[]
  clientId?: string
  component: string
  hidden: boolean
  menuId: number
  meta: FluffyMeta
  name: string
  path: string
  redirect: string
  redirectUrl?: string
  remark?: string
  targetId: number
}

export interface ChildChild {
  component: string
  hidden: boolean
  menuId: number
  meta: PurpleMeta
  name: string
  path: string
  targetId: number
}

export interface PurpleMeta {
  clientId: null
  icon: null | string
  isFrame: string
  isSwitch: string
  link: null
  menuId: number
  noCache: boolean
  redirectUrl: null
  targetId: number
  title: string
}

export interface FluffyMeta {
  clientId: null | string
  icon: null | string
  isFrame: string
  isSwitch: string
  link: null
  menuId: number
  noCache: boolean
  redirectUrl: null | string
  targetId: number
  title: string
}

export interface DatumMeta {
  clientId: null
  icon: string
  isFrame: string
  isSwitch: string
  link: null
  menuId: number
  noCache: boolean
  redirectUrl: null
  targetId: number
  title: string
}

export interface SmsReq {
  /**
   * 图片验证码
   */
  captcha: string
  /**
   * 短信类型 3-短信验证码
   */
  smsType: number
  /**
   * 用户名
   */
  username: string
  /**
   * 图片验证码uuid
   */
  uuid: string
}

export interface CaptchaRes {
  /**
   * 验证码是否关闭
   */
  captchaOnOff: boolean
  /**
   * 状态吗 200-成功  其它失败
   */
  code: number
  /**
   * 返回的数据
   */
  data: Data
  /**
   * 返回的信息
   */
  msg: string
}

/**
 * 返回的数据
 */
export interface Data {
  /**
   * 验证码图片
   */
  img: string
  /**
   * 验证码uuid
   */
  uuid: string
}
